<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">

	<title>config</title>

	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

	<link rel="stylesheet" href="/layui/css/layui.css" media="all">
	<script src="/layui/layui.js" charset="utf-8"></script>
	<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
	<style>
		.box {
			width: 1400px;
			margin: 0 auto;
		}

		.layui-row {
			margin-bottom: 30px;
		}
	</style>
</head>

<body>
	<br><br>

	<div class="box">

		<!-- 动态数据表格 -->
		<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>

	</div>
	<script>

		layui.use(['form', 'table'], function () {
			var $ = layui.jquery, form = layui.form, table = layui.table, notice = layui.notice;

			// request("table")
			let tableName = request("table");
			table.render({
				elem: '#currentTableId',
				url: '/config.html',
				where: {
					table: tableName
				},
				cols: [[
					{field: 'codeGenId', width: 80, title: '表ID', hide: true, },
					{field: 'columnName', width: 150, title: '表字段', },
					{field: 'propertyName', width: 150, title: 'JavaBean属性', },
					{field: 'columnType', width: 100, title: '表字段类型', },
					{field: 'type', width: 150, title: 'JavaBean类型', },
					{field: 'formType', width: 100, title: '作用类型', },
					{field: 'remark', width: 300, title: '字段描述', },
					{field: 'isShow', width: 100, title: '列显示', },
					{field: 'isForm', width: 100, title: '增改', },
					{field: 'isSelect', width: 100, title: '查询', },
					{field: 'selectType', width: 100, title: '查询方式', }
				]],
				response: {
					statusCode: 200,
				},
				limits: [100, 200, 500],
				limit: 100,
				skin: 'row|line',
			});

			/* 获取URL指定参数的值 */
			function request(paras) {
				let url = location.href;
				let paraString = url.substring(url.indexOf("?") + 1, url.length).split("&");
				let paraObj = {}
				for (i = 0; j = paraString[i]; i++) {
					paraObj[j.substring(0, j.indexOf("=")).toLowerCase()] = j.substring(j.indexOf("=") + 1, j.length);
				}
				let returnValue = paraObj[paras.toLowerCase()];
				if (typeof (returnValue) == "undefined") {
					return null;
				} else {
					return returnValue;
				}
			}
		});
	</script>
</body>

</html>